package com.xiangge.domain;

public class Book {
    // 定义私有属性
    private Integer id;
    private String title;
    private String author;
    private double price;
    private Integer sales;
    private Integer stock;
    // 定义展示方法
    public void show(){
        System.out.println("本书"+title+"的编号为"+id+"作者是"+author+"，价格为"+price+"，最近的销量"+sales+"还不错，库存还有"+stock+"本");
    }
    // 无参构造方法
    public Book() {
    }
    // 有参构造方法
    public Book(Integer id, String title, String author, double price, Integer sales, Integer stock) {
        this.id = id;
        this.title = title;
        this.author = author;
        this.price = price;
        this.sales = sales;
        this.stock = stock;
    }
    // 私有属性，使用get和set方法获取属性

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Integer getSales() {
        return sales;
    }

    public void setSales(Integer sales) {
        this.sales = sales;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }
}
